import time

from selenium import webdriver
from selenium.webdriver.common.by import By

from pywinauto import keyboard

drive = webdriver.Chrome()
drive.maximize_window()
drive.get("https://iviewui.com/view-ui-plus/component/form/upload")
time.sleep(1)

# 针对button标签上传文件
drive.find_element(By.XPATH, "//button[@class='ivu-btn ivu-btn-default']").click()
time.sleep(2)
# 发送本地电脑的文件路径
keyboard.send_keys(r"D:\11.png")
time.sleep(3)
# 按键盘上的enter
keyboard.send_keys('{ENTER}')
drive.close()
